<html>
<head><meta charset="utf-8"><title>rustc debug · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html">rustc debug</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="151444803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151444803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jethro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151444803">(Dec 11 2018 at 13:21)</a>:</h4>
<p>Are there any Linux rustc builds with debug symbols available or will I have to build my own?</p>



<a name="151445312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151445312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151445312">(Dec 11 2018 at 13:29)</a>:</h4>
<p><span class="user-mention" data-user-id="138938">@Jethro</span> there are the <code>alt</code> builds, AFAIK they have debug symbols. you can install them via <a href="https://github.com/kennytm/rustup-toolchain-install-master" target="_blank" title="https://github.com/kennytm/rustup-toolchain-install-master">https://github.com/kennytm/rustup-toolchain-install-master</a></p>



<a name="151445373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151445373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151445373">(Dec 11 2018 at 13:30)</a>:</h4>
<p>I don't believe they do but would be happy to be wrong -- they exist primarily to enable LLVM asserts</p>



<a name="151445438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151445438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jethro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151445438">(Dec 11 2018 at 13:31)</a>:</h4>
<p>you mean to <em>disable</em>?</p>



<a name="151445501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151445501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151445501">(Dec 11 2018 at 13:32)</a>:</h4>
<p>LLVM asserts are not enabled on regular builds; alt builds enable those</p>



<a name="151445555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151445555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151445555">(Dec 11 2018 at 13:33)</a>:</h4>
<p>oh was it just LLVM asserts? dang, I thought it was all sorts of debug asserts</p>



<a name="151445740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151445740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151445740">(Dec 11 2018 at 13:36)</a>:</h4>
<p>Looks like verify-llvm-ir and llvm-asserts are the only two options enabled by alt builds</p>



<a name="151445800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151445800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jethro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151445800">(Dec 11 2018 at 13:37)</a>:</h4>
<p>did that change? it used to be other other way around</p>



<a name="151445851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151445851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151445851">(Dec 11 2018 at 13:38)</a>:</h4>
<p>A while back, yeah</p>



<a name="151448291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151448291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jethro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151448291">(Dec 11 2018 at 14:16)</a>:</h4>
<p>so I built the compiler with <code>./x.py build --stage=0 src/rustc</code>, but I can't quite figure out how to run it</p>



<a name="151448337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151448337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151448337">(Dec 11 2018 at 14:17)</a>:</h4>
<p><span class="user-mention" data-user-id="138938">@Jethro</span> first, build it with <code>./x.py build --stage 1 src/libtest</code> (EDIT: should have been <code>libtest</code>, sorry)</p>



<a name="151448348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151448348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151448348">(Dec 11 2018 at 14:17)</a>:</h4>
<p>or else you got yourself a nice compiler without a libstd, which is not very useful :P</p>



<a name="151448449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151448449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151448449">(Dec 11 2018 at 14:18)</a>:</h4>
<p>second, add the stage 1 sysroot to rustup. that'd be using <code>rustup toolchain link</code>, and the sysroot lives in <code>build/*/stage1</code></p>



<a name="151448572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151448572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151448572">(Dec 11 2018 at 14:20)</a>:</h4>
<p>then you can use that toolchain like any other. it is not 100% feature complete (compiler plugins and things needing <code>rustc_private</code> won't work, but as of recently, proc macros should work) but should get you quite far</p>



<a name="151448724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151448724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jethro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151448724">(Dec 11 2018 at 14:22)</a>:</h4>
<p>nevermind, <span class="user-mention" data-user-id="116015">@Alex Crichton</span> saves the day and frees me from having to build the compiler :)</p>



<a name="151450369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151450369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jethro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151450369">(Dec 11 2018 at 14:45)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> just for future reference, I only cared about the frontend, I only wanted to use <code>rustc --print</code>, would've that been possible with just the stage0?</p>



<a name="151451196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151451196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151451196">(Dec 11 2018 at 14:57)</a>:</h4>
<p><span class="user-mention" data-user-id="138938">@Jethro</span> I would be surprised but I don't know</p>



<a name="151451254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151451254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151451254">(Dec 11 2018 at 14:58)</a>:</h4>
<p>and anyway, <code>libtest</code> adds just ~90s to the build time (if you don't need proc_macros or libtest, you can use <code>libstd</code> which takes just ~60s)</p>



<a name="151451460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151451460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jethro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151451460">(Dec 11 2018 at 15:01)</a>:</h4>
<p>no it was starting to build LLVM, which it wasn't doing before</p>



<a name="151451596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151451596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151451596">(Dec 11 2018 at 15:02)</a>:</h4>
<p>oh, I keep forgetting about the codegen backends</p>



<a name="151451658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20debug/near/151451658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jethro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20debug.html#151451658">(Dec 11 2018 at 15:03)</a>:</h4>
<p>actually I guess <code>--print cfg</code> needs the codegen backend to properly interpret the features, so probably no deal</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>